import java.awt.Graphics;
import java.util.LinkedList;

import javax.swing.JFrame;


public class Freeze extends Weapon {
	Unit enemy;

	public Freeze( LinkedList<Effect> effects, Unit enemy, double startX, double startY, double endX, double endY, double size, double ap ){
		super(effects,startX,startY,endX,endY,size,ap);
		this.enemy = enemy;
		
	}
	double freezetimer;
	int damage;
	double scaledStartX;
	double scaledStartY;
	double scaledEndX;
	double scaledEndY;
	double scaledSize;
	int G = 0;

	public void scale( double size, double normal, double [] ref){
		scaledStartX = startX*size/normal + ref[0] ;
		scaledStartY = startY*size/normal + ref[1] ;
		scaledEndX = enemy.getX()*size/normal + ref[0];
		scaledEndY = enemy.getY()*size/normal + ref[1];
		scaledSize = this.size*size/normal;
	}

	public boolean getAlive(){ return alive; }

	public void damage(){
		enemy.freeze(freezetimer);
	}
	public void work(){
		damage();
	}

	public void draw(Graphics g, JFrame c){
		for(int i=0; i < size/2; i++){
			//g.drawLine();
			//int newG = (int)(Math.random()*256) + G;
			int newG = 0;
			if (G < -255){
				alive = false;
			}
			G -= 10;
		}
	}
}
